
import { defineStore } from 'pinia';
import { VariateName } from '@/utils/enum';
import { computed, reactive, watch } from 'vue';
import type { StatesType } from './state';
import { states } from './state';
export const global =  defineStore(VariateName.GLOBAL,()=>{
    const state:any= reactive<StatesType>({
        ...states
    })
    const stateUpdate=(key:keyof StatesType,value:unknown)=>{
        state[key] = value;
        JSON.parse(JSON.stringify(state))
    }
    return{
        state,
        stateUpdate,
    }
})